package cn.com.cifi.mars.web.action.sys;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import cn.com.cifi.mars.bean.vo.sys.req.SaveSysRoleReqParam;
import cn.com.cifi.mars.bean.vo.sys.req.UpdateSysRoleReqParam;
import cn.com.cifi.mars.bean.vo.sys.rsp.SysRoleVo;
import cn.com.cifi.mars.common.bean.R;
import cn.com.cifi.mars.common.constants.VersionConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@Api(tags = {"系统管理"})
@RequestMapping("/${spring.data.rest.base-path}/{apiVersion}/sys/role")
public interface ISysRoleController {

	 @ApiOperation(value = "新增角色", notes = "新增角色")
	 @PostMapping(value = "")
	 public R<String> createRole(
	            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
	           
	            @RequestBody SaveSysRoleReqParam param);
	 
	 @ApiOperation(value = "编辑角色", notes = "编辑角色")
	 @PutMapping(value = "")
	 public R<String> updateRole(
	            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
	            
	            @RequestBody UpdateSysRoleReqParam param);
	 
	 @ApiOperation(value = "分页查询特殊角色列表", notes = "分页查询特殊角色列表")
	 @GetMapping(value = "pageList")
	 public R<SysRoleVo> getRolePageList(
	            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
	            @ApiParam(value = "当前第几页", required = true, defaultValue = "1") @RequestParam(value = "current") String current,
	            @ApiParam(value = "每页条数", required = true, defaultValue = "2") @RequestParam(value = "pageSize") String pageSize);

	 
	 @ApiOperation(value = "删除角色", notes = "删除角色")
	 @DeleteMapping(value = "{roleId}")
	 public R<String> deleteRoleById(
	            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
	            
	            @ApiParam(value = "角色Id", required = true, defaultValue = "0") @RequestParam(name = "roleId") String roleId);

	 
}
